package org.geektimes.projects.userweb.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

/**
 * @Author: jipeng
 * @Description:
 * @Date: Created in 2021/5/9 23:53
 */
@RestController
@RequestMapping("config")
public class NacosValueController {


    @NacosValue(value = "${my.mybatis.driver}", autoRefreshed = true)
    private String driver;

    @RequestMapping(value = "/get", method = GET)
    @ResponseBody
    public String get() {
        return driver;
    }


}
